<?php

class Application_Model_Vacancy extends Zend_Db_Table_Abstract
{
    protected $_name = 'vacancy';
    public function getAllVacancy() {
        $select = $this->select()
                       ->from($this->_name);
        return $this->fetchAll($select)->toArray();
    }
    
    public function getSelectVacancy($id) {
        $select = $this->select()
                       ->from($this->_name)
                       ->where('id = ?', intval($id));
        return $this->fetchAll($select)->toArray();
    }
    
    public function addVacancy($data) {
        $this->insert($data);
    }
    
    public function updateVacancy($id, $data) {
        $this->update($data, 'id =' . intval($id));
    }
    
    public function deleteVacancy($id) {
        $this->delete('id =' . intval($id));
    }
}

